﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BlackjackSimulator
{
    public class Player
    {
        #region Attributes
        protected string _Name;
        
        public string Name
        {
            get { return _Name; }
            set { _Name = value; }
        }
        protected Hand _Hand1;

        public Hand Hand1
        {
            get { return _Hand1; }
            set { _Hand1 = value; }
        }
        protected Hand _Hand2;

        public Hand Hand2
        {
            get { return _Hand2; }
            set { _Hand2 = value; }
        }
        protected int _NumHand;

        public int NumHand
        {
            get { return _NumHand; }
            set { _NumHand = value; }
        }
        protected int _Point;

        public int Point
        {
            get { return _Point; }
            set { _Point = value; }
        }
        protected int _Money;

        public int Money
        {
            get { return _Money; }
            set { _Money = value; }
        }
        private int _Bet;

        protected int Bet
        {
            get { return _Bet; }
            set { _Bet = value; }
        }

        private bool _isWin;

        public bool IsWin
        {
            get { return _isWin; }
            set { _isWin = value; }
        }
        #endregion

        public Player()
        {
            this._Name = "";
            this._Hand1 = new Hand();
            this._Hand2 = new Hand();
            this._NumHand = 1;
            this._Point = 0;
            this._Money = 0;
            this._Bet = 0;
            this.IsWin = false; 
        }

        public Player(string name, int bet)
        {
            this._Name = name;
            this._Hand1 = new Hand();
            this._Hand2 = new Hand();
            this._NumHand = 1;
            this._Point = 0;
            this._Money = 0;
            this._Bet = bet;
            this.IsWin = false;
        }

        public void Reset()
        {
            this._Hand1 = new Hand();
            this._Hand2 = new Hand();
            this._NumHand = 1;
            this._Point = 0;
            this.IsWin = false;
        }

        public virtual void Hit()
        {
        }

        public virtual void Stand()
        {
        }

        public virtual void DoubleDown()
        {
        }

        public virtual void SplitAPair()
        {
            _Hand2.Add(_Hand1.GetCard(0));
            _Hand1.RemoveAt(0);
        }

        public virtual void Surrender()
        {
            this._Money -= this._Bet;
            this._Bet = 0;
        }
       
        public virtual string Display()
        {
            return "";
        }
       
        public bool checkSplit()
        {
            if (_Hand1.GetCard(0).IsSameFaceValue(_Hand1.GetCard(1)) == true)
                return true;
            return false;
        }
    }
}   
